home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / perl40_2.zip / DIR.H < prev    next >
C/C++ Source or Header  |  1991-12-19  |  2KB  |  71 lines

  1. /* $RCSfile: dir.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:22:10 $
  2.  *
  3.  *    (C) Copyright 1987, 1990 Diomidis Spinellis.
  4.  *
  5.  *    You may distribute under the terms of either the GNU General Public
  6.  *    License or the Artistic License, as specified in the README file.
  7.  *
  8.  * $Log:    dir.h,v $
  9.  * Revision 4.0.1.1  91/06/07  11:22:10  lwall
  10.  * patch4: new copyright notice
  11.  *
  12.  * Revision 4.0  91/03/20  01:34:20  lwall
  13.  * 4.0 baseline.
  14.  *
  15.  * Revision 3.0.1.1  90/03/27  16:07:08  lwall
  16.  * patch16: MSDOS support
  17.  *
  18.  * Revision 1.1  90/03/18  20:32:29  dds
  19.  * Initial revision
  20.  *
  21.  *
  22.  */
  23.  
  24.  
  25. /*
  26.  * defines the type returned by the directory(3) functions
  27.  */
  28.  
  29.  
  30. #ifndef __DIR_INCLUDED
  31. #define __DIR_INCLUDED
  32.  
  33.  
  34. /*Directory entry size */
  35. #ifdef DIRSIZ
  36. #undef DIRSIZ
  37. #endif
  38. #define DIRSIZ(rp)    (sizeof(struct direct))
  39.  
  40. typedef int ino_t;
  41.  
  42. /*
  43.  * Structure of a directory entry
  44.  */
  45. struct direct    {
  46.     ino_t    d_ino;            /* inode number (not used by MS-DOS) */
  47.     int    d_namlen;        /* Name length */
  48.     char    d_name[13];        /* file name */
  49. };
  50.  
  51.  
  52. struct _dir_struc {            /* Structure used by dir operations */
  53.     char *start;            /* Starting position */
  54.     char *curr;            /* Current position */
  55.     struct direct dirstr;        /* Directory structure to return */
  56. };
  57.  
  58.  
  59. typedef struct _dir_struc DIR;        /* Type returned by dir operations */
  60.  
  61.  
  62. DIR *cdecl opendir(char *filename);
  63. struct direct *readdir(DIR *dirp);
  64. long telldir(DIR *dirp);
  65. void seekdir(DIR *dirp,long loc);
  66. void rewinddir(DIR *dirp);
  67. void closedir(DIR *dirp);
  68.  
  69.  
  70. #endif /* __DIR_INCLUDED */
  71.